package com.cq.androidtools.jetpack.databinding

import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
import com.cq.androidtools.databinding.ActivityUserBinding
import com.cq.base.utils.ToastUtils

/**
 * 作者: CQ
 * 日期: 2021-05-25
 * 说明:
 */
class UserActivity : DataBindingActivity<ActivityUserBinding>() {
    override fun ActivityUserBinding.initBinding() {

    }
    override fun intData() {
        super.intData()
        val userAdapter = UserAdapter()
        with(mBinding.recyclerView) {
            layoutManager = LinearLayoutManager(this@UserActivity).apply {
                orientation = androidx.recyclerview.widget.RecyclerView.VERTICAL
            }
            adapter = userAdapter
        }
        userAdapter.setData(
            listOf(
                Teacher(1, "Person", "语文"),
                Student(2, "Person", "一年级"),
                Teacher(3, "Person", "数学")
            )
        )
        mBinding.name = A()
        ToastUtils.makeText(this, "测试提示", Toast.LENGTH_SHORT).show()
    }

}